package com.ruoyi.vpn.service.impl;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.vpn.mapper.VpnOrderMapper;
import com.ruoyi.vpn.domain.VpnOrder;
import com.ruoyi.vpn.service.IVpnOrderService;

/**
 * 订单Service业务层处理
 * 
 * @author Edwin
 * @date 2024-04-24
 */
@Service
public class VpnOrderServiceImpl implements IVpnOrderService 
{
    @Autowired
    private VpnOrderMapper vpnOrderMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public VpnOrder selectVpnOrderById(Long id)
    {
        return vpnOrderMapper.selectVpnOrderById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param vpnOrder 订单
     * @return 订单
     */
    @Override
    public List<VpnOrder> selectVpnOrderList(VpnOrder vpnOrder)
    {


        List<VpnOrder> vpnOrders = vpnOrderMapper.selectVpnOrderList(vpnOrder);

        return vpnOrders;
    }

    /**
     * 新增订单
     * 
     * @param vpnOrder 订单
     * @return 结果
     */
    @Override
    public int insertVpnOrder(VpnOrder vpnOrder)
    {
        return vpnOrderMapper.insertVpnOrder(vpnOrder);
    }

    /**
     * 修改订单
     * 
     * @param vpnOrder 订单
     * @return 结果
     */
    @Override
    public int updateVpnOrder(VpnOrder vpnOrder)
    {
        return vpnOrderMapper.updateVpnOrder(vpnOrder);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteVpnOrderByIds(Long[] ids)
    {
        return vpnOrderMapper.deleteVpnOrderByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteVpnOrderById(Long id)
    {
        return vpnOrderMapper.deleteVpnOrderById(id);
    }

    @Override
    public VpnOrder selectVpnOrderByOrderId(String orderId) {

        return vpnOrderMapper.selectVpnOrderByOrderId(orderId);
    }
}
